import sys
class Screen:
    def __init__(self, width=640, height=480):
        if (width <= 0 or width > 1000) or (height <= 0 or height > 1000):
            print("invalid screen size")
            sys.exit()
        else:
            self.__width = width
            self.__height = height
        print("screen")

    def set_width(self, width):
        if width <= 0 or width > 1000:
            print("invalid screen size")
            sys.exit()
        else:
            self.__width = width

    def set_height(self, height):
        if height <= 0 or height > 1000:
            print("invalid screen size")
            sys.exit()
        else:
            self.__height = height

    def get_width(self):
        return self.__width

    def get_height(self):
        return self.__height

class Rectangle:
    def __init__(self, x1=0, y1=0, x2=0, y2=0, screen=None):
        self.__left_x = x1
        self.__left_y = y1
        self.__right_x = x2
        self.__right_y = y2
        self.__screen = screen
        print("rectangle")

    def set_coordinations(self, x1, y1, x2, y2):
        self.__left_x = x1
        self.__left_y = y1
        self.__right_x = x2
        self.__right_y = y2

    def set_screen(self, screen):
        self.__screen = screen

    def draw(self):
        if 0 < self.__left_x < self.__right_x and 0 < self.__left_y < self.__right_y and \
           self.__right_x < self.__screen.get_width() and \
           self.__right_y < self.__screen.get_height():
            print(self.__left_x, self.__left_y, self.__right_x - self.__left_x, self.__right_y - self.__left_y)
        else:
            print("invalid rectangle")

def main():
    line = input().split()
    width = float(line[0])
    height = float(line[1])
    screen = Screen(width, height)
    left_x,  left_y, right_x, right_y = (eval(x) for x in input().split())
    r1 = Rectangle(left_x, left_y, right_x, right_y, screen)
    rs = [Rectangle(), Rectangle()]
    rs[1].set_coordinations(10, 300, 700, 500)
    rs[1].set_screen(screen)
    r1.draw()
    for i in range(2):
        rs[i].set_screen(screen)
        rs[i].draw()

main()